package com.coco.thread.start;

/**
 * 创建线程的方式二 通过实现 Runnable 接口
 */
public class WayThread02 {

    public static class MyThread implements Runnable{

        public void run() {
            String threadName = Thread.currentThread().getName();
            System.out.println("working by Runnable ..."+threadName);
        }
    }


    public static void main(String[] args) {
        MyThread myThread = new MyThread();
        Thread thread = new Thread(myThread);
        thread.setName("coco");
        thread.start();
    }
}
